import axios from '@/axios'
enum API {
    ROLE_GETALL = '/getRoleAll',
    ROLE_GETPAGE = '/getRolePage',
    ROLE_GETKEYPAGE = '/SearchRoleKey',
    ROLE_UPDATEBYID = '/updataRoleById',
    ROLE_DELETEBYID = '/deleteRoleById',
    ROLE_DELETEMOREBYID = '/deleteRoleMoreById',
    ROLE_ADD = '/addRole',
}
// 获取所有角色信息
export const getRoleAllAPI = () => axios.get(API.ROLE_GETALL)
// 分页查询角色
export const getRolePageAPI = (data: any) => axios.post(API.ROLE_GETPAGE, data)
// 指定key-value分页查询角色
export const getRoleKeyPageAPI = (data: any) => axios.post(API.ROLE_GETKEYPAGE, data)
// 根据id更新角色
export const UpdateRoleByIdAPI = (data: any) => axios.post(API.ROLE_UPDATEBYID, data)
// 根据id删除角色
export const DeleteRoleByIdAPI = (id: string) => axios.delete(`${API.ROLE_DELETEBYID}/${id}`)
// 根据id批量角色
export const DeleteRoleMoreByIdAPI = (ids: any) => axios.post(API.ROLE_DELETEMOREBYID, ids)
// 添加角色
export const AddRoleAPI = (data: any) => axios.post(API.ROLE_ADD, data)